﻿//创建时间: 2010-10-13
//创建作者: 李晓忠
//功能说明: CMS系统 文件选择 
//修改: 2010-10-14
using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using TRPOP.Common;
using TRPOP.CMS.Web.UI;

using TRPOP.CMS.Business;
using TRPOP.CMS.Model;
using Newtonsoft.Json;


namespace TRPOP.CMS.Admin
{
    public partial class AdminSelect : BaseAdmin
    {

        #region 页面变量
        protected string m_strSetId = "";
        protected string m_strAction = "";
        protected string m_strRootType = "";
        protected string m_strRootTypeName = "";
        #endregion

        #region 页面事件
        protected void Page_Load(object sender, EventArgs e)
        {

            m_strRootType = RequestHelper.RequestString("roottype");
            m_strSetId = RequestHelper.RequestString("setid");   

                if (!IsPostBack)
                {
                    LoadBase();
                }
           
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {

        }
        #endregion

        #region 页面方法

        public void LoadBase()
        {
            switch (m_strRootType.ToLower())
            {
                case "templete"://读取模板目录
                    filepanel.Visible = true;
                    ddlRoot.DataSource = TempleteConfigInfo.GetTempelteRoot;
                    ddlRoot.DataBind();
                    m_strRootTypeName = "路径";
                    break;
                case "psn":
                    filepanel.Visible = true;
                    List<PSNInfo> olpsnList = (new PSNManage()).GetListByCondition(0, "", " psnid asc");
                    ddlRoot.Items.Clear();
                    foreach (PSNInfo opsnInfo in olpsnList)
                    {
                        ddlRoot.Items.Add(new ListItem(opsnInfo.Name, opsnInfo.psnid + "|" + opsnInfo.Root));
                    }
                    ddlRoot.DataBind();
                    m_strRootTypeName = "路径";
                    break;
                case "root":
                    filepanel.Visible = true;
                    ddlRoot.Items.Clear();
                    ddlRoot.Items.Add(new ListItem("系统根目录", "/"));
                    ddlRoot.DataBind();
                    m_strRootTypeName = "路径";
                    break;
                default://movenode restorenode createnodebase doccut doccopy createlink createindexlink
                    filepanel.Visible = true;
                    break;
            }
        }

       
        #endregion
    }
}
